home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
extras
/
programm
/
gemfsc19
/
gemfsc19.lzh
/
GEMFUNCS
/
WNDUPDAT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-02-01
|
963b
|
32 lines
/**************************************************************************
* WNDUPDAT.C - Implement nested wind_update() logic.
*************************************************************************/
#include "gemfintl.h"
#undef wind_update /* undo GEMFAST.H remapping, we need The Real Thing */
static short windowcount;
static short mousecount;
short wnd_update(flag)
short flag;
{
short *counter;
counter = (flag & 0x0002) ? &mousecount : &windowcount;
if (flag & 0x0001) { /* BEG_UPDATE or BEG_MCTRL, count */
if (++(*counter) == 1) { /* it. if we went from 0 to 1, we */
return wind_update(flag); /* need to aquire the semaphore. */
}
} else { /* END_UPDATE or END_MCTRL */
if (*counter > 0) { /* if we're currently holding */
if (--(*counter) == 0) { /* semaphore, decr count, if */
return wind_update(flag); /* it goes to 0, release it. */
}
}
}
return 1;
}